#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include<math.h>

void printInt(int a) {
    int b = a;
    int count = 0;
    while (a) {
        a /= 1000;
        count++;
    }
    count--;
    int c = b / pow(1000,count);
    while (c) {
        printf("%c", c % 10 + '0');
        c /= 10;
    }
    while (count--) {
        b /= 1000;
        printf(",");
        printf("%c", b /100 % 10 + '0');
        printf("%c", b /10 % 10 + '0');
        printf("%c", b % 10 + '0');
    }
}

int main() {
    int a;
    a = 10000000;
    printInt(a);

    return 0;
}